﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WH.Common.DbConfig.Model
{
    public class ConfigInputDto
    {
        /// <summary>
        ///  Key
        ///</summary>
        [Required]
        [MaxLength(50, ErrorMessage = "Key最大长度50")]
        public string Key { get; set; } = null!;
        /// <summary>
        ///  值
        ///</summary>
        [MaxLength(255, ErrorMessage = "值最大长度255")]
        public object? Value { get; set; }
        /// <summary>
        /// 描述 
        ///</summary>
        [Required]
        [MaxLength(255, ErrorMessage = "描述最大长度255")]
        public string Description { get; set; } = null!;

        /// <summary>
        /// 配置类别
        /// </summary>
        [MaxLength(255, ErrorMessage = "配置类别最大长度255")]
        public string? ConfigCategory { get; set; }

        /// <summary>
        /// 注释
        /// </summary>
        [MaxLength(255, ErrorMessage = "注释最大长度255")]
        public string? Summary { get; set; }

        /// <summary>
        /// 排序 
        ///</summary>
        public int SortNo { get; set; }

        /// <summary>
        /// 类型 1：JSON 2：Array
        /// </summary>
        public int? DataType { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 组件类型
        /// </summary>
        [Required]
        [MaxLength(50, ErrorMessage = "组件类型最大长度50")]
        public string ComponentType { get; set; } = null!;

        [MaxLength(50, ErrorMessage = "组件默认值最大长度50")]
        public string? ComponentDefaultValue { get; set; }
        /// <summary>
        /// 父级id
        /// </summary>
        [Required]
        public string ParentId { get; set; } = null!;

        public string? Id { get; set; }


        public List<ConfigInputDto>? Children { get; set; }

        public bool? IsEnable { get; set; }
    }
}
